// const path = require('path');
// const HtmlWebpackPlugin = require('html-webpack-plugin')
// const { CleanWebpackPlugin } = require('clean-webpack-plugin')

// module.exports = {
//   mode: 'development',
//   entry: './src/main.js',
//   output: {
//     filename: 'app.[hash:8].js',
//     path: path.resolve(__dirname, 'dist'),
//   },
//   devtool: 'inline-source-map',
//   devServer: {
//     contentBase: './dist',
//   },
//   plugins: [
//     new CleanWebpackPlugin({ cleanStaleWebpackAssets: false }),
//     new HtmlWebpackPlugin({
//       title: 'Development',
//     }),
//   ],
//   module: {
//     rules: [
//       {
//         test: /\.css$/i,
//         use: ['style-loader', 'css-loader'],
//       },
//       {
//         test: /\.(png|svg|jpg|jpeg|gif)$/i,
//         type: 'asset/resource',
//       },
//       {
//         test: /\.(woff|woff2|eot|ttf|otf)$/i,
//         type: 'asset/resource',
//       },
//     ],
//   },
// };
const commonConfig = require('./webpack.common')
const { merge } = require('webpack-merge')

const path = require('path')


module.exports = merge(commonConfig, {
  mode: 'development',
  devtool: 'eval-cheap-module-source-map',
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: 'eslint-loader',
        enforce: 'pre'
      },
    ]
  },
  devServer: {
    contentBase: path.join(__dirname, 'dist'),
    port: 9000,
    // open: true,
    hot: true
  }
})